/*
 * @Description: 系统管理-医院基本信息管理
 * @Date: 2023-07-27 15:26:29
 * @FilePath: \hksj-vued:\03code\hk-iot\src\api\system\hospital\index.ts
 */
import axiosRequest from '/@/utils/request';

/**
 * 医院基本信息管理接口集合
 * @method addHospital 新增
 * @method delHospital 删除
 * @method updateDictionary 修改
 * @method queryHospitalListByPaging 查询医院列表
 * @method queryCityTree 查询省市区树
 * @method queryHospitalById 根据医院id查询医院信息
 */
export function useHospitalApi() {
  return {
    addHospital: async (params: object) => {
      const res = await axiosRequest({
        url: '/api/hospital/addHospital',
        method: 'post',
        data: params,
      });
      return res;
    },
    delHospital: async (params: { 'id': string }) => {
      const res = await axiosRequest({
        url: `/api/hospital/delHospital/${params.id}`,
        method: 'delete',
        data: params,
      });
      return res;
    },
    updateHospital: async (params: object) => {
      const res = await axiosRequest({
        url: '/api/hospital/updateHospital',
        method: 'put',
        data: params,
      });
      return res;
    },
    queryHospitalListByPaging: async (params: {
      "name": string,
      "cityIds": any,
      "pageNum": number,
      "pageSize": number
    }) => {
      const res = await axiosRequest({
        url: '/api/hospital/queryHospitalListByPaging',
        method: 'post',
        data: params,
      });
      return res;
    },
    queryCityTree: async () => {
      const res = await axiosRequest({
        url: '/api/hospital/queryCityTree',
        method: 'get',
      });
      return res;
    },
    queryHospitalById: async (id: string) => {
      const res = await axiosRequest({
        url: `/api/hospital/queryHospitalById/${id}`,
        method: 'get',
      });
      return res;
    }
  };
}
